<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Custom Confirm Dialog</title>
    <link href="https://cdn.jsdelivr.net/npm/sweetalert2@10" rel="stylesheet">
</head>
<body>
<button onclick="showConfirmation()">删除数据</button>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<script>
    function showConfirmation() {
        Swal.fire({
            title: '确定要删除这条数据吗？',
            icon: 'warning',
            showCancelButton: true,
            confirmButtonText: '确定',
            cancelButtonText: '取消'
        }).then((result) => {
            if (result.isConfirmed) {
                console.log("用户点击了确认按钮");
            } else {
                console.log("用户点击了取消按钮");
            }
        });
    }
</script>
</body>
</html>
